
package com.work.db.entity;

import com.vaadin.data.util.converter.Converter;
import com.work.i18n.Messages;
import com.work.util.StringToTimeConverter;

public enum OvertimeFieldEnum {
	BEGIN(true, "begin", 100, new StringToTimeConverter()), 
	END(true, "end", 100, new StringToTimeConverter()), 
	DESCRIPTION(true, "description", null, null);

	private boolean visible;
	private String fieldName;
	private Integer columnWidth;
	private Converter<String, ?> converter;

	OvertimeFieldEnum(String fieldName) {
		this.fieldName = fieldName;
	}
	
	private OvertimeFieldEnum(boolean visible, String fieldName, Integer columnWidth, Converter<String, ?> converter) {
		this.visible = visible;
		this.fieldName = fieldName;
		this.columnWidth = columnWidth;
		this.converter = converter;
	}



	public boolean isVisible()
	{
		return visible;
	}

	public void setVisible(boolean visible)
	{
		this.visible = visible;
	}

	public String getFieldName()
	{
		return fieldName;
	}

	public void setFieldName(String fieldName)
	{
		this.fieldName = fieldName;
	}

	public Integer getColumnWidth()
	{
		return columnWidth;
	}

	public void setColumnWidth(Integer columnWidth)
	{
		this.columnWidth = columnWidth;
	}

	public Converter<String, ?> getConverter()
	{
		return converter;
	}

	public void setConverter(Converter<String, ?> converter)
	{
		this.converter = converter;
	}

	public String getFieldLabel()
	{
		return Messages.get(fieldName);
	}
}
